/** 查询缓存详细 */
export function getCacheApi(): Promise<ApiDataRecord<CacheRecord>> {
  return request({
    url: '/monitor/cache',
    method: 'get'
  })
}

/** 查询缓存名称列表 */
export function listCacheNameApi(): Promise<ApiDataRecord<CacheItemRecord[]>> {
  return request({
    url: '/monitor/cache/getNames',
    method: 'get'
  })
}

/** 查询缓存键名列表 */
export function listCacheKeyApi(cacheName: string): Promise<ApiDataRecord<string[]>> {
  return request({
    url: '/monitor/cache/getKeys/' + cacheName,
    method: 'get'
  })
}

/** 查询缓存内容 */
export function getCacheValueApi(cacheName: string, cacheKey: string): Promise<ApiDataRecord<CacheItemRecord>> {
  return request({
    url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey,
    method: 'get'
  })
}

/** 清理指定名称缓存 */
export function clearCacheNameApi(cacheName: string): Promise<ApiRecord> {
  return request({
    url: '/monitor/cache/clearCacheName/' + cacheName,
    method: 'delete'
  })
}

/** 清理指定键名缓存 */
export function clearCacheKeyApi(cacheKey: string): Promise<ApiRecord> {
  return request({
    url: '/monitor/cache/clearCacheKey/' + cacheKey,
    method: 'delete'
  })
}

/** 清理全部缓存 */
export function clearCacheAllApi(): Promise<ApiRecord> {
  return request({
    url: '/monitor/cache/clearCacheAll',
    method: 'delete'
  })
}
